<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>v-for遍历数组</title>
</head>
<body>
<div id="app">

<!--  在遍历过程中没有使用到下标值-->
  <ul>
    <li v-for="item in names">{{item}}</li>
  </ul>

<!--  使用下标值-->
  <ul>
    <li v-for="(item, index) in names">{{index+1}}.{{item}}</li>
  </ul>
</div>
<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      names: ['aaa', 'bbb', 'ccc', 'ddd']
    }
  })
</script>
</body>
</html>
